package tools;


/**
 * Builds a triplet in memory
 * @author guillaumes
 *
 * @param <X> : the type of the first element of the triplet
 * @param <Y> : the type of the second element of the triplet
 * @param <Z> : the type of the third element of the triplet
 */
public class Triplet<X,Y,Z> 
{
	private  X x;
	private  Y y;
	private Z z;
	
	/**
	 * 
	 * @param x : the first element of the triplet
	 * @param y : the second element of the triplet
	 * @param z : the third element of the triplet
	 */
	public Triplet(X x,Y y,Z z)
	{
		this.x=x;
		this.y=y;
		this.z=z;
	}
	
	
	public X get0() {
		return(x);
	}

	
	public Y get1() {
		return(y);	
	}

	public Z get2() {
		return(z);	
	}

	
	public boolean equals(Object o)
	{
		if (!(o.getClass().equals(this.getClass()))) return(false);
		Triplet<X,Y,Z> p=(Triplet<X,Y,Z>)o;
		return(p.get0().equals(get0()) && p.get1().equals(get1()) && p.get2().equals(get2()));
	}
}
